<template>
<rx-dialog @handOk="handleSubmit" @cancel="cancel">
  <a-form :form="form" >
    <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="i18n('form.name','名称')">
      <a-input :placeholder="i18n('form.name','名称')" v-decorator="['name', {rules: [{required: false, message: i18n('form.name','名称','input')}]}]"/>
    </a-form-item>
    <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="i18n('form.categoryId','分类ID')">
      <a-input :placeholder="i18n('form.categoryId','分类ID')" v-decorator="['categoryId', {rules: [{required: false, message: i18n('form.categoryId','分类ID','input')}]}]"/>
    </a-form-item>
    <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="i18n('form.alias','别名')">
      <a-input :placeholder="i18n('form.alias','别名')" v-decorator="['alias', {rules: [{required: false, message: i18n('form.alias','分类ID','input')}]}]"/>
    </a-form-item>
    <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="i18n('form.template','模版')">
      <a-textarea :placeholder="i18n('form.template','模版')" v-decorator="['template', {rules: [{required: false, message: i18n('form.template','模版','input')}]}]" :rows="4" />
    </a-form-item>
    <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="i18n('form.javaScript','表单脚本')">
      <a-textarea :placeholder="i18n('form.javaScript','表单脚本')" v-decorator="['javascript', {rules: [{required: false, message: i18n('form.javaScript','表单脚本','input')}]}]" :rows="4" />
    </a-form-item>
    <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="i18n('form.status','发布状态')">
      <a-input-number :min="0" :max="1000000" :placeholder="i18n('form.status','发布状态')" v-decorator="['deployed', {rules: [{required: false, message: i18n('form.status','发布状态','input')}]}]" />
    </a-form-item>
    <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="i18n('form.bodefId','业务模型ID')">
      <a-input :placeholder="i18n('form.bodefId','业务模型ID')" v-decorator="['bodefId', {rules: [{required: false, message: i18n('form.bodefId','业务模型ID','input')}]}]"/>
    </a-form-item>
    <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="i18n('form.version','版本号')">
      <a-input-number :min="0" :max="1000000" :placeholder="i18n('form.version','版本号')" v-decorator="['version', {rules: [{required: false, message: i18n('form.version','版本号','input')}]}]" />
    </a-form-item>
    <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="i18n('form.mainVersion','主版本')">
      <a-input-number :min="0" :max="1000000" :placeholder="i18n('form.mainVersion','主版本')" v-decorator="['main', {rules: [{required: false, message: i18n('form.mainVersion','主版本','input')}]}]" />
    </a-form-item>
  </a-form>
</rx-dialog>

</template>
<script>
  import FormPcApi from '@/api/form/core/formPc';
  import {BaseForm,RxDialog} from "@lowcode/jpaas-common-lib";
  export default {
    name: 'FormPcEdit',
    mixins:[BaseForm],
    components: {
      RxDialog,
    },
    methods: {
      i18n(name,text,key){
          return this.$ti18(name,text,"formPc",key);
      },
      get(id){
        console.info(id);
        return FormPcApi.get(id);
      },
      save(values){
        return FormPcApi.save(values);
      }
    }
  }
</script>
